package edu.sctu.zcy.month201505.day20150510;



/**
 * Created by user24 on 2015/5/10.
 */
import java.lang.Thread;

public class ThreadDemo extends Thread {

    private String name;

    public void getNameOne(String name){
        this.name = name;

    }

    public void run(){

        System.out.println("线程启动："+this.name);
        for (int i = 0; i < 10; i++) {
            System.out.println(name+"运行：i="+i);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        System.out.println("线程结束："+this.name);
    }
}

